Skip to content

Conversation

thortve
Copy link
Member

@thortve thortve commented Oct 12, 2026

Load the detail and submit pages with React.lazy, so only the landing page is in the first download. Lazy-load the map in the result list too, with a placeholder of the same size, so the text of the results renders before Leaflet arrives.

JavaScript needed before the first render goes from 636.65 kB (196.43 kB gzip) to 464.62 kB (143.93 kB gzip), and the Vite warning about chunks over 500 kB is gone. The landing page still fetches Leaflet (49.92 kB gzip) for the map thumbnails, but after first render.

Refs #55

Load the detail and submit pages with React.lazy, so only the landing
page is in the first download. Lazy-load the map in the result list
too, with a placeholder of the same size, so the text of the results
renders before Leaflet arrives.

JavaScript needed before the first render goes from 636.65 kB
(196.43 kB gzip) to 464.62 kB (143.93 kB gzip), and the Vite warning
about chunks over 500 kB is gone. The landing page still fetches
Leaflet (49.92 kB gzip) for the map thumbnails, but after first render.

Refs #55

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thortve thortve added this to the Partial submission 2 milestone Oct 12, 2026
@thortve thortve self-assigned this Oct 12, 2026
@thortve thortve linked an issue Oct 12, 2026 that may be closed by this pull request
6 tasks
@thortve thortve marked this pull request as ready for review October 12, 2026 11:06
@thortve thortve requested a review from a team as a code owner October 12, 2026 11:06
@asgeija
Copy link
Member

asgeija commented Oct 12, 2026

@thortve could you resolve the merge conflict. I will review after.

@asgeija asgeija self-requested a review October 12, 2026 11:47
@asgeija asgeija added the chore label Oct 12, 2026
thortve and others added 2 commits October 12, 2026 13:47
The merge kept the older test body, which rendered SightingList
without totalCount and the paging props that main now requires, so
the test threw on totalCount.toLocaleString. Use the renderList
helper from main and keep waiting for the lazy-loaded map.

Refs #55

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy link
Member

@asgeija asgeija left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thortve thortve merged commit c049741 into main Oct 12, 2026
1 check passed
Sign in to join this conversation on GitHub.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce the amount of JavaScript the browser downloads on the first page load.
2 participants